package com.zx._01_基础._011_集合;

import java.lang.reflect.Field;
import java.util.Vector;
import org.junit.Test;
import org.springframework.util.ReflectionUtils;

public class LinkedListTest {

    @Test
    public void test01() throws IllegalAccessException {
        Vector<String> li = new Vector<String>(10);
        Field findField = ReflectionUtils.findField(Vector.class, "elementData");
        findField.setAccessible(true);
        for (int i = 0; i < 100; i++) {
            if ((i + 1) % 10 == 0) {
                li.add("1");
                Object[] os = (Object[]) findField.get(li);
                System.out.println(li.size() + "~" + os.length);
            } else {
                li.add("1");
            }
        }
    }

}
